import 'package:auto_route/auto_route.dart';
import 'package:distribution_mall_flutter/assets.dart';
import 'package:distribution_mall_flutter/pages/user/delete_account/delete_account_deleting_loading/applicaion/delete_account_deleting_loading_service.dart';
import 'package:distribution_mall_flutter/utils/common_widget.dart';
import 'package:flutter/material.dart';
import 'package:flutter_riverpod/flutter_riverpod.dart';

@RoutePage()
class DeleteAccountDeletingLoadingPage extends ConsumerStatefulWidget {
  final String captchaToken;
  final String accountName;
  final String accountType;

  const DeleteAccountDeletingLoadingPage({
    super.key,
    @pathParam required this.captchaToken,
    @pathParam required this.accountName,
    @pathParam required this.accountType,
  });

  @override
  ConsumerState createState() => _DeleteAccountDeletingLoadingPageState();
}

class _DeleteAccountDeletingLoadingPageState
    extends ConsumerState<DeleteAccountDeletingLoadingPage> {
  @override
  Widget build(BuildContext context) {
    ref.watch(deleteAccountDeletingLoadingServiceProvider(
        widget.captchaToken, widget.accountName, widget.accountType));
    return Scaffold(
      appBar: AppBar(
        title: const Text('ACCOUNT DELETION'),
        leading: CommonBtnWidget.arrowBack(),
      ),
      body: Column(
        children: [
          Divider(
            height: 1,
          ),
          Container(
            decoration: BoxDecoration(
              color: const Color(0xFF3F3F3F),
              borderRadius: BorderRadius.circular(14),
            ),
            margin: const EdgeInsets.only(top: 97, bottom: 24),
            padding: const EdgeInsets.symmetric(horizontal: 26, vertical: 24),
            child: Image.asset(
              Assets.assets_icons_delete_account_delete_loading_png,
              width: 28,
            ),
          ),
          const Text(
            'YOUR ACCOUNT INFORMATION IS BEING DELETED……',
            style: TextStyle(fontSize: 14, color: Colors.black),
          ),
        ],
      ),
    );
  }
}
